module game
{
	/**pop的对象池 */
	export class PopPool
	{
		private static _pops:Array<BasePop> = new Array<BasePop>();

		public static store(pop:BasePop):void
		{
			if(pop.parent)
			{
				pop.parent.removeChild(pop);
			}
			pop.clear();
			this._pops.push(pop);
		}

		public static create():BasePop
		{
			let pop:BasePop;

			if(this._pops.length > 0)
			{
				pop = this._pops.pop();
			}
			else
			{
				pop = new BasePop();
			}
			return pop;
		}
	}
}